﻿@{
    ViewBag.Title = "忘记密码";
    Layout = "~/Views/Shared/_layout.cshtml";
}
@section sidebar {
    @Html.Partial("_not_login_sidebar")
}
<div class="es-form">
    <form id="forget" action="/User/SubmitForget">
        <div class="row">
            <div class="col-md-2">用户名</div>
            <div class="col-md-6">
                <input class="form-control" type="text" name="username" required />
            </div>
        </div>
        <div class="row">
            <div class="col-md-2">电子邮箱</div>
            <div class="col-md-6">
                <input class="form-control" type="email" name="email" required />
            </div>
        </div>
        <div class="row">
            <div class="col-md-2">
                <input class="btn btn-primary btn-sm" type="submit" value="提交" />
            </div>
        </div>
    </form>
</div>
<script>
    $('#forget').submit(function (event) {
        $.ajax({
            type: "POST",
            url: "/User/SubmitForget",
            data: $(this).serialize(),
            success: function (data) {
                if (data === true) {
                    alert("已提交")
                } else {
                    alert("提交失败");
                }
            }
        });
        event.preventDefault();
    })
</script>